package com.jinmdz.fmis.mapper.mapper;

import org.apache.ibatis.annotations.*;
import com.jinmdz.fmis.mapper.mapper.provider.CremationFurnaceRefuelProvider;
import com.jinmdz.fmis.mapper.entity.CremationFurnaceRefuelEntity;

import java.util.ArrayList;

/**
 * 火化炉加油记录表Mapper
 * 
 * @author generator
 * @date 2020-08-23 18:11
 */
public interface CremationFurnaceRefuelMapper {

    /**
     * 增加CremationFurnaceRefuel
     * 
     * @param entity 数据实体
     * @return
     * @author generator
     * @date 2020-08-23 18:11
     */
    @InsertProvider(type = CremationFurnaceRefuelProvider.class, method = "insertCremationFurnaceRefuel")
    @Options(useGeneratedKeys = true, keyProperty = "entity.id", keyColumn = "id")
    void insertCremationFurnaceRefuel(@Param("entity") CremationFurnaceRefuelEntity entity);

    /**
     * 删除CremationFurnaceRefuel
     * 
     * @param id 主键
     * @param modifiedUserId 修改用户外键
     * @param version 版本号
     * @return
     * @author generator
     * @date 2020-08-23 18:11
     */
    @Update(" update cremation_furnace_refuel set deleted = 1,modified_user_id = #{modifiedUserId},version = unix_timestamp(now()) where id = #{id} and version = #{version} and unmodified = 0 and deleted = 0 ")
    void deletedForCremationFurnaceRefuel(@Param("id") Integer id, @Param("modifiedUserId") Integer modifiedUserId, @Param("version") Long version);

    /**
     * 修改CremationFurnaceRefuel
     * 
     * @param entity 数据实体
     * @return
     * @author generator
     * @date 2020-08-23 18:11
     */
    @UpdateProvider(type = CremationFurnaceRefuelProvider.class, method = "updateCremationFurnaceRefuel")
    void updateCremationFurnaceRefuel(@Param("entity") CremationFurnaceRefuelEntity entity);

    /**
     * 查询CremationFurnaceRefuel实体
     * 
     * @param id 主键
     * @return CremationFurnaceRefuelEntity
     * @author generator
     * @date 2020-08-23 18:11
     */
    @Select(" select id,deleted,furnace_group_id,old_number,refuel_number,new_number,refuel_time,funeral_parlour_code,create_user_id,gmt_create,unmodified,modified_user_id,gmt_modified,version from cremation_furnace_refuel where id = #{id} and deleted = 0 limit 1 ")
    CremationFurnaceRefuelEntity getCremationFurnaceRefuelById(@Param("id") Integer id);

    /**
     * 查询CremationFurnaceRefuel列表
     * 
     * @param entity 数据实体
     * @return CremationFurnaceRefuelEntity
     * @author generator
     * @date 2020-08-23 18:11
     */
    @SelectProvider(type = CremationFurnaceRefuelProvider.class, method = "listCremationFurnaceRefuel")
    ArrayList<CremationFurnaceRefuelEntity> listCremationFurnaceRefuel(@Param("entity") CremationFurnaceRefuelEntity entity);
}